#import <Cocoa/Cocoa.h>

typedef enum {
    kDivider_None,
    kDivider_Forward,  // "/"
    kDivider_Backward // "\"
} BWThread_StitchDivider;

@class BWThread;

@interface BWCrossStitch : NSObject <NSCoding>
{
    int row;
    int column;

    BWThread *topThread;
    BWThread *bottomThread;

    BWThread_StitchDivider divider;

    int tag;
}

- (int) row;
- (int) column;

- (BWThread *) topThread;
- (BWThread *) bottomThread;
- (BWThread_StitchDivider) divider;

- (int) tag; // defaults to -1

- (BWCrossStitch *) initWithRow: (int) r
                         column: (int) c
                         thread: (BWThread *) k;

- (BWCrossStitch *) initWithRow: (int) r
                         column: (int) c
                      topThread: (BWThread *) k1
                   bottomThread: (BWThread *) k2
                        divider: (BWThread_StitchDivider) d;

- (BWCrossStitch *) initWithRow: (int) r
                         column: (int) c
                         thread: (BWThread *) k
                            tag: (int) tag;

- (BWCrossStitch *) initWithRow: (int) r
                         column: (int) c
                      topThread: (BWThread *) k1
                   bottomThread: (BWThread *) k2
                        divider: (BWThread_StitchDivider) d
                            tag: (int) tag;

- (BOOL) isPartialStitch;

// returns nil if there's no replacement to be done
- (BWCrossStitch *) stitchByReplacingThread: (BWThread *) search
                                 withThread: (BWThread *) replace
                                        tag: (int) tag;

@end // BWCrossStitch


